<?php


/*preg_match("/(\\?space\/(.*?)\/zz)/is","?space/zzz/blog/",$out);

echo $out[2];exit();*/

	function preg($pregx,$url){
			if($pregx == $url) return true;
			
			$pregx = str_replace('%','(.*?)',$pregx);
			$pregx = str_replace('/','\/',$pregx);
			//$pregx = str_replace('=','\=',$pregx);
			
			preg_match("/(\\?".$pregx."#)/is",'?'.$url.'#',$out);
			return $out[2];
		}
		
		
		var_dump(preg("module=yellowpage&file=company","module=yellowpage&file=company"));
		
		if(preg("module=yellowpage&file=company","module=yellowpage&file=company")){
			echo 'yes';
		}
		else{
			echo 'no';
		}
		
		echo preg("module=yellowpage&action=web&category=guestbook&userid=%","module=yellowpage&action=web&category=guestbook&userid=81");
		
		
		preg_match("/(http:\/\/(.*?)#)/is",'http://www.baidu.com#',$a);
		var_dump($a[2]);
		
		
		var_dump(strpos('http://qzapp.qlogo.cn/qzapp/100297168/E9687E10DD246793C7143A2EBA842370/100','http://'));
		
		if(strpos('http://qzapp.qlogo.cn/qzapp/100297168/E9687E10DD246793C7143A2EBA842370/100','http://') !== false){
			echo 1;
		} 
		else{
			echo 2;
		}
		
		
		echo preg('module=yellowpage&action=%&userid=1','module=yellowpage&action=news&userid=1');
		
?>